package com.cloudkinto.vo.order.returns;

import com.cloudkinto.dto.order.returns.OrderReturnUtilDto;
import com.cloudkinto.dto.order.returns.pack.PackTrackDto;
import com.cloudkinto.dto.stock.back.OrderReturnStockDto;
import com.cloudkinto.vo.file.FileRes;
import com.cloudkinto.vo.order.returns.pack.OrPackDetailRes;
import com.cloudkinto.vo.operate.OperateRes;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
public class OrDetailRes extends OrderReturnUtilDto {

    @ApiModelProperty("物流跟踪号")
    private List<PackTrackDto> trackList;

    @ApiModelProperty("销售平台")
    private String salesPlatForm;
    @ApiModelProperty("备注")
    private  String remark;

    @ApiModelProperty("退件产品")
    private List<OrProductDetailRes> products;
    @ApiModelProperty("按库位产品")
    private List<OrderReturnStockDto> racks;

    @ApiModelProperty("包裹")
    private List<OrPackDetailRes> packs;

    @ApiModelProperty("oms附件")
    private List<FileRes> omsFiles;
    @ApiModelProperty("wms附件")
    private List<FileRes> wmsFiles;
    @ApiModelProperty("进度条")
    private List<OrProgressRes> progress;

    @ApiModelProperty("操作日志")
    private List<OperateRes> operateResList;
    @ApiModelProperty("能否到仓暂存 0 可以 1不可以")
    private int reachStatus;

    public int getReachStatus() {
        if (packs == null || packs.isEmpty()) return 1;
        long count = packs.stream().filter(i -> i.getReach() == 0).count();
        return count > 0 ? 0 : 1;
    }
    //能不能 到仓暂存
//    private int packStatus;

}
